package com.sdap2.entity;

import com.sdap2.common.entity.LogicEntity;
import jakarta.persistence.*;
import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@Entity
@Table(name = "camera_data")
@EqualsAndHashCode(callSuper = true)
public class CameraData extends LogicEntity {
    
    @ManyToOne
    @JoinColumn(name = "device_id", nullable = false, 
                foreignKey = @ForeignKey(name = "camera_data_device_fk",
                                       foreignKeyDefinition = "FOREIGN KEY (device_id) REFERENCES device (id) ON DELETE CASCADE"))
    private Device device;
    
    @Column(name = "pic_url", length = 200, nullable = false)
    private String picUrl;
} 